package com.mzj.eagle.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropertiesUtils {
	
	public static Properties properties = null;
	
	static {
		properties = PropertiesUtils.loadProperties("/prop.properties");
	}
	
	 //加载property文件到io流里面  
    public static Properties loadProperties(String propertyFile) {  
        Properties properties = new Properties();  
        try {  
            InputStream is = PropertiesUtils.class.getResourceAsStream(propertyFile);  
            properties.load(is);  
        } catch (IOException e) {  
            e.printStackTrace();  
        }  
        return properties;  
    }  
  
    /** 
     * 根据key值取得对应的value值 
     * @param key 
     * @return 
     */  
    public static String getProperty(String key) {  
        return properties.getProperty(key);  
    }  


    
}
